package Types;

import java.util.ArrayList;
import java.util.List;

public class DrugDDIFile {

    String fileName;
    String drugName;
    String source;
    List<Sentence> lstSentence;

    public DrugDDIFile(String fn, String su) {
        lstSentence = new ArrayList<Sentence>();
        fileName = fn;
        drugName = drug_name_Ex();
        source = su;
    }

    public String getDrugName() {
        return drugName;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String file_name) {
        this.fileName = file_name;
    }

    public List<Sentence> getLstSentence() {
        return lstSentence;
    }

    public void setistSentence(List<Sentence> list_sent) {
        this.lstSentence = list_sent;
    }

    private String drug_name_Ex() {
        if (!fileName.contains("_")) {
            return null;
        }
        String[] tem = fileName.split("_");
        return tem[0];
    }

    public void printAllSent() {
        System.out.println("File Name : " + this.fileName);
        System.out.println("Drug Name : " + this.drugName);
        System.out.println("Source : " + this.source);
        for (int i = 0; i < this.lstSentence.size(); i++) {
            this.lstSentence.get(i).print();
        }
    }
}
